package com.oh.core.server.handler.system;

import com.oh.core.common.base.MessageService;
import com.oh.core.common.constant.CommandEnum;
import com.oh.core.common.utils.ServiceRouteFactory;
import com.oh.core.entity.MessageEntity;
import io.netty.channel.ChannelHandlerContext;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Service;

/**
 * 心跳，可以不做任何处理
 */
@Service
public class HeartBeatHandler implements MessageService, InitializingBean {

    @Override
    public int handle(ChannelHandlerContext ctx, MessageEntity msg) {
        return 0;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        ServiceRouteFactory.register(CommandEnum.HEART_BEAT.getCommand(), this);
    }
}
